<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 烽
  Date: 2015/7/16
  Time: 22:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <title>${title}|${subtitle}</title>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.4/css/bootstrap.css">

    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="http://apps.bdimg.com/libs/bootstrap/3.3.4/js/bootstrap.min.js"></script>

    <!--ckeditor -->
    <script src="<%=request.getContextPath()%>/resource/plugin/ckeditor/ckeditor.js"></script>


</head>
<body>
<div id="all" class="col-md-12">
    <jsp:include page="/WEB-INF/views/common/head.jsp"/>
    <jsp:include page="/WEB-INF/views/common/menu.jsp"/>
    <div id="form" class="col-md-10 col-md-offset-1">
        <form action="<%=request.getContextPath()%>/blog/addBlogHandle" method="post">
            <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
            <input name="id" type="hidden" value="${article.id}">
            <div class="form-group">
                <input type="text" class="form-control" id="title" placeholder="标题" name="title" value="${article.title}">
            </div>
            <div class="form-group">
                <select  class="form-control" name="type">
                    <c:forEach items="${articleTypes}" var="t">
                        <option value="${t.id}"
                            <c:if test="${t.id == article.type}">selected="selected"</c:if>
                        >${t.name}</option>
                    </c:forEach>
                </select>
            </div>
            <div class="form-group">
                <textarea class="form-control" rows="10" name="content">${article.content}</textarea>
                <script type="text/javascript">CKEDITOR.replace('content');</script>
            </div>
            <div class="form-group">
                <div class="col-md-offset-5 col-sm-2">
                    <button type="submit" class="btn btn-default">发布</button>
                </div>
            </div>
        </form>

    </div>
    <jsp:include page="/WEB-INF/views/common/foot.jsp"/>

</div>
</body>
</html>


</div>
</body>
</html>

